/**
 * 
 */
package com.taobao.wolfwolf.hibernate.service.impl;

import java.util.List;

import com.taobao.wolfwolf.hibernate.dao.SpecsDao;
import com.taobao.wolfwolf.hibernate.pojo.Specs;
import com.taobao.wolfwolf.hibernate.service.SpecsService;

/**
 * @author Tux
 *
 * 创建时间: 2011-5-19 上午10:25:25
 */
public class SpecsServiceImpl extends BaseServiceImpl implements SpecsService {
	private SpecsDao sdao;

	public List<Specs> findAll() {
		try {
			return sdao.findAll();
		} catch(Exception e) {
			e.printStackTrace();
		}
		return null;
	}

	public Specs findById(int id) {
		try {
			return sdao.findById(id);
		} catch (Exception e) {
			e.printStackTrace();
			System.out.println("Error at findById(int id)");
		}
		return null;
	}

	public List<Specs> findByName(String name) {
		try {
			return sdao.findByName(name);
		}  catch (Exception e) {
			e.printStackTrace();
			System.out.println("Error at findByName(String name)");
		}
		return null;
	}

	public long getTotal()  {
		try {
			return sdao.getTotal();
		}  catch (Exception e) {
			e.printStackTrace();
			System.out.println("Error at getTotal()");
		}
		return -1;
	}

	public List<Specs> paging(int page, int limit)  {
		try {
			return sdao.paging(page, limit);
		}  catch (Exception e) {
			e.printStackTrace();
			System.out.println("Error at paging(int page, int limit)");
		}
		return null;
	}

	public void setsdao(SpecsDao sdao) {
		this.sdao = sdao;
	}

	public SpecsDao getsdao() {
		return sdao;
	}

	public int hasEntity(Specs specs) {
		try {
			return sdao.hasEntity(specs);
		} catch (Exception e) {
			e.printStackTrace();
			System.out.println("Error at hasEntity(Specs specs)");
		}
		
		return -1;
	}
}
